package:
  name: xformers
  version: "{{ environ.get('BUILD_VERSION') }}"

source:
 path: "{{ environ.get('SOURCE_ROOT_DIR') }}"

requirements:
  build:
    - ninja
    - pytorch={{ environ.get('PYTORCH_VERSION') }}
  host:
    # - numpy >=1.11
    - python
    - pytorch={{ environ.get('PYTORCH_VERSION') }}
    - {{environ['CONDA_CUDA_CONSTRAINT_BUILD']}}

  run:
    # - numpy >=1.11
    - python
    - pytorch={{ environ.get('PYTORCH_VERSION') }}
    - {{environ['CONDA_CUDA_CONSTRAINT_RUN']}}

build:
  string: py{{py}}_cu{{ environ['CU_VERSION'] }}_pyt{{ environ['PYTORCH_VERSION']}}
  script: {{environ['PYTHON']}} setup.py install --single-version-externally-managed --record=record.txt
  script_env:
    - BUILD_VERSION
    - FORCE_CUDA
    - GIT_TAG
    - MAX_JOBS
    - TORCH_CUDA_ARCH_LIST
    - XFORMERS_BUILD_TYPE
    - XFORMERS_PACKAGE_FROM
    - CUDA_HOME

about:
  home: https://github.com/facebookresearch/xformers
  license: BSD
  license_file: LICENSE
  summary: 'Hackable and optimized Transformers building blocks, supporting a composable construction.'

extra:
  checkout: "{{ environ['GIT_TAG'] }}"
